package com.atguigu.spzx.manager.mapper;

import com.atguigu.spzx.model.entity.system.SysMenu;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * ClassName: SysMenuMapper
 * Package:
 * Description:
 *
 * @Author:xiaohei
 * @Create 2024/5/19 14:26
 * Version 1.0
 */
@Mapper
public interface SysMenuMapper {
    //查询所有菜单
    List<SysMenu> findAll();

    //添加菜单
    void save(SysMenu sysMenu);

    void update(SysMenu sysMenu);

    //根据当前菜单来查看是否含有子菜单
    int selectCountById(Long id);

    //根据id删除
    void delete(Long id);

    //根据userId查询可以操作菜单
    List<SysMenu> findMenusByUserId(Long userId);

    //获取当前添加菜单的父菜单
    SysMenu selectParentMenu(Long parentId);
}
